﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using WmWebSystem.Models;
using WmWebSystem.Service;
using WmWebSystem.DbHelper;

namespace WmWebSystem.Controllers
{
    public class FavouriteController : Controller
    {
        //
        // GET: /Favourite/

        public ActionResult Index()
        {
            return View();
        }

        [AcceptVerbs(HttpVerbs.Get)]
        public JsonResult Create(string pno) 
        {
            string user = HttpContext.User.Identity.Name;
            ChildProjectHelper.AddChildProjectsToFavourites(pno, user);
            JsonResult json = new JsonResult
            {
                Data = new
                {
                    list = 1
                }
            };
            return Json(json, JsonRequestBehavior.AllowGet);
        }
        

    }
}
